# Maintainer: Andrea Scarpino <andrea@archlinux.org>

pkgname=mythes-it
pkgver=2.0.9l
_pkgver=02_09_l
_date=2008_11_29
pkgrel=9
pkgdesc="Italian thesaurus"
arch=('any')
url="https://sourceforge.net/projects/linguistico/"
license=('GPL3')
optdepends=('libmythes: offers thesaurus library functions')
source=("https://downloads.sourceforge.net/linguistico/thesaurus2_it_${_pkgver}_${_date}.zip")
sha256sums=('e8223872c3a81c76be7683ad1a3097852e8b916015e2225f35ee72bf345b5522')

package() {
  install -dm755 "${pkgdir}"/usr/share/mythes

  install -m644 th_it_IT.dat "${pkgdir}/usr/share/mythes/th_it_IT_v2.dat"
  install -m644 th_it_IT.idx "${pkgdir}/usr/share/mythes/th_it_IT_v2.idx"

  pushd "${pkgdir}"/usr/share/mythes/
  it_IT_aliases="it_CH"
    for lang in $it_IT_aliases; do
      ln -s th_it_IT_v2.idx th_${lang}_v2.idx
      ln -s th_it_IT_v2.dat th_${lang}_v2.dat
    done
  popd

  # the symlinks
  install -dm755 "${pkgdir}"/usr/share/myspell/dicts
  pushd "${pkgdir}"/usr/share/myspell/dicts
    for file in "${pkgdir}"/usr/share/mythes/*; do
      ln -sv /usr/share/mythes/$(basename $file) .
    done
  popd
}
